<?php

class ServersController extends AppController {
    
    public $layout = "admin";

    public $sl_servidores = array(
        "actions" => array("V" => "view", "E" => "edit", "D" => "delete"),
        "filters" => array(
            array("name" => 'Server.id', "label" => 'Código'),
            array("name" => 'Server.tipo', "label" => 'Tipo', "presentation" => 'SERVERS::TIPO')
        ),
        "columns" => array(
            array("name" => 'Server.id', "label" => 'Código'),
            array("name" => 'Server.tipo', "label" => 'Tipo'),
            array("name" => 'Server.host', "label" => 'Host'),
            array("name" => 'Server.cuenta', "label" => 'Cuenta')
        )
    );
    public $maint_servidores = array(
        "fields" => array(
            "Descripción del Servidor" => array(
				array("name" => "fecha_carga", "label" => "Fecha Carga", "presentation" => "DATETIME", 'classparams' => '{"force":true}', 'isvisible' => false, "actions" => "A"),
                array("name" => 'estado', "label" => 'Estado', "presentation" => 'ESTADO', 'initialvalue' => 'Activo'),
                array("name" => 'tipo', "label" => 'Tipo', "presentation" => 'SERVERS::TIPO'),
                array("name" => 'host', "label" => 'Host'),
                array("name" => 'puerto', "label" => 'Puerto', 'size' => '5'),
                array("name" => 'usuario', "label" => 'Usuario'),
                array("name" => 'clave', "label" => 'Clave'),
                array("name" => 'cuenta', "label" => 'Cuenta')
            )
        )
    );

    public function add() {
        $this->maint = $this->maint_servidores;
        parent::add();
    }

    public function edit($id = null) {
        $this->maint = $this->maint_servidores;
        parent::edit($id);
    }

    public function index() {
        $this->search_list = $this->sl_servidores;
        parent::index();
    }

    public function view($id = null) {
        $this->maint = $this->maint_servidores;
        parent::view($id);
    }

}